import {ADD_CHAT} from '../actionTypes'

const initialState = []

export default function(state = initialState, action) {

  console.log("chatData in reducer " + JSON.stringify(action));

  switch (action.type) {

    case ADD_CHAT: {
      const message = action.payload;
      return [
        ...state,
        message
      ];
    }
    
    default:
      return state;
  }
}
